package com.cskaoyan.service.impl;

import com.cskaoyan.mapper.MarketGoodsAttributeMapper;
import com.cskaoyan.model.MarketGoodsAttribute;
import com.cskaoyan.service.GoodsAttributeService;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class GoodsAttributeServiceImpl implements GoodsAttributeService {
    @Override
    public void create(SqlSession sqlSession, List<MarketGoodsAttribute> attributes, Integer goodsId) {
        MarketGoodsAttributeMapper attributeMapper = sqlSession.getMapper(MarketGoodsAttributeMapper.class);
        for (MarketGoodsAttribute attribute : attributes) {
            attribute.setGoodsId(goodsId);
            attributeMapper.insertSelective(attribute);
        }
    }
}
